<?php
	class Catalog_model extends CI_Model {
	    public function get_catalog(){
	        $query = $this->db->get('catalog');
	        return $query->result();
	    }
	    public function get_one($id){
	    	$query=$this->db->where("id",$id)->get('catalog');
	    	return $query->row();
	    }
	     public function add_one($data){
	    	$this->db->insert('catalog', $data);
	    }
	    public function edit_one($id,$data){
	    	$this->db->where('id', $id);
	    	$this->db->update('catalog', $data);
	    }
	    public function del_id($id){
			$this->db->where('id', $id);
			$query=$this->db->delete('catalog');
	    }
	}